﻿using System;
using System.Collections.Generic;
using System.Text;

namespace HenIT.BizTalk.Objects
{
    public class SendPort
    {
        public bool Match { get; set; }
        public string Name { get; set; }
        public BoolMatch IsTwoWay { get; set; }
        public BoolMatch IsDynamic { get; set; }
        public BoolMatch OrderedDelivery { get; set; }
        public BoolMatch StopSendingOnFailure { get; set; }
        public StringMatch Filter { get; set; }
        public BoolMatch RouteFailedMessage { get; set; }
        public StringMatch ReceivePipeline { get; set; }
        public StringMatch ReceivePipelineData { get; set; }
        public StringMatch SendPipeline { get; set; }
        public StringMatch SendPipelineData { get; set; }
        public IntMatch Priority { get; set; }        

        private TransportInfo primaryTransport = new TransportInfo();
        public TransportInfo PrimaryTransport {
            get { return primaryTransport; } 
        }
        private TransportInfo secondaryTransport = new TransportInfo();
        public TransportInfo SecondaryTransport {
            get { return secondaryTransport; }
        }
        private List<StringMatch> inboundMaps = new List<StringMatch>();
        public List<StringMatch> InboundMaps
        {
            get { return inboundMaps; }
        }
        private List<StringMatch> outboundMaps = new List<StringMatch>();
        public List<StringMatch> OutboundMaps
        {
            get { return outboundMaps; }
        }

        public void MatchPropertiesWith(SendPort sp2)
        {
            IsTwoWay.Value2 = sp2.IsTwoWay.Value;
            IsDynamic.Value2 = sp2.IsDynamic.Value;
            OrderedDelivery.Value2 = sp2.OrderedDelivery.Value;
            Filter.Name2 = sp2.Filter.Name;
            RouteFailedMessage.Value2 = sp2.RouteFailedMessage.Value;
            ReceivePipeline.Name2 = sp2.ReceivePipeline.Name;
            ReceivePipelineData.Name2 = sp2.ReceivePipelineData.Name;
            SendPipeline.Name2 = sp2.SendPipeline.Name;
            SendPipelineData.Name2 = sp2.SendPipelineData.Name;
            Priority.Value2 = sp2.Priority.Value;
            StopSendingOnFailure.Value2 = sp2.StopSendingOnFailure.Value;
        }
    }
}
